//
//  HNSH_ApplyRefundHeader.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/3/1.
//

#import "HNSH_ApplyRefundHeader.h"

@interface HNSH_ApplyRefundHeader ()
@property (nonatomic, strong)UILabel * titleLabel;
@end

@implementation HNSH_ApplyRefundHeader

//MARK: Cycle Methods
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        [self addAllViews];
        [self addAllLayout];
    }
    return self;
}

- (void)addAllLayout{
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(16);
        make.right.mas_equalTo(-16);
        make.top.height.mas_equalTo(self);
    }];
}

//MARK: Myself Methods
- (void)addAllViews{
    [self addSubview:self.titleLabel];
}

//MARK: Setter Methods
- (void)setDic:(NSDictionary *)dic{
    _dic = dic;
    
    NSString *string = [NSString stringWithFormat:@"%@",dic[@"title"]];
    self.titleLabel.text = string;
    if ([string containsString:@"*"]) {
        self.titleLabel.attributedText = [ST_AttributeLabelTool handleLabelWithContent:self.titleLabel.text SelectContent:@"*" CommonFont:self.titleLabel.font SpeFont:self.titleLabel.font Color:[UIColor appGreenColor]];
    }
}

//MARK: Getter Methods
- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [UILabel new];
        _titleLabel.font = [UIFont systemFontOfSize:16];
        _titleLabel.textColor = [UIColor appBlack333LabelColor];
    }
    return _titleLabel;
}

@end
